<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>珍爱网注册_免费注册珍爱网</title>
    <%@ include file="core.jsp" %>

    <script>
        // 页面加载完毕执行的函数
        $(document).ready(function () {
            // 给省的下拉框绑定一个change改变事件
            $("#province").change(function () {
                var pid = this.value;
                $("#city>option:gt(0)").remove();
                $.get("${ctx}/dictionary/find/" + pid, function (res) {
                    $.each(res, function (i, o) {
                        $("#city").append("<option value='" + o.id + "'>" + o.name + "</option>");
                    });
                }, "json");

            });

            $("#city").change(function () {
                var pid = this.value;
                $("#area>option:gt(0)").remove();
                $.get("${ctx}/dictionary/find/" + pid, function (res) {
                    $(res).each(function (i, o) {
                        $("#area").append("<option value='" + o.id + "'>" + o.name + "</option>");
                    });
                }, "json");

            });
        });

    </script>
</head>
<body>
${msg}
<form action="${ctx}/n/register" method="post">
    <fieldset>
        <h3>编辑征婚资料</h3>
        <div>
            我是一位
            <input type="radio" value="1" name="gender">男士
            <input type="radio" value="0" name="gender">女士
        </div>
        <div>
            我的生日
            <input type="text" name="birthday">
        </div>
        <div>
            婚姻状态
            <input name="maritalStatus" type="radio" value="1">未婚
            <input name="maritalStatus" type="radio" value="2">离婚
            <input name="maritalStatus" type="radio" value="0">丧偶
        </div>
        <div>
            我的身高
            <input type="text" name="height">
        </div>
        <div>
            我的工作地
            <select id="province">
                <option value="">--请选择--</option>
                <c:forEach var="province" items="${requestScope.provinceList }">
                    <option value="${province.id}">${province.name}</option>
                </c:forEach>
            </select>

            <select id="city">
                <option value="">--请选择--</option>
            </select>

            <select name="workplace" id="area">
                <option value="">--请选择--</option>
            </select>
        </div>
        <div>
            我的学历
            <select name="education" id="education">
                <option value="">--请选择--</option>
                <c:forEach var="education" items="${requestScope.educationList }">
                    <option value="${education.id}">${education.name}</option>
                </c:forEach>
            </select>
        </div>
        <div>
            我的月收入
            <select name="income" id="income">
                <option value="">--请选择--</option>
                <c:forEach var="range" items="${requestScope.rangeList }">
                    <option value="${range.id}">${range.name}</option>
                </c:forEach>
            </select>
        </div>
    </fieldset>
    <fieldset>
        <h3>注册账户</h3>
        <div>
            我的手机
            <input type="text" name="username">
        </div>
        <div>
            创建密码
            <input type="password" name="password">
        </div>
    </fieldset>
    <div>
        <input type="submit" value="同意协议并注册">
    </div>
</form>
</body>
</html>
